//
//  MyShipmentInfoCell.m
//  ReceiptDelivery
//
//  Created by 吕晶 on 2020/10/26.
//  Copyright © 2020 吕晶. All rights reserved.
//

#import "MyShipmentInfoCell.h"

@interface MyShipmentInfoCell ()

@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UILabel *faTitleLab;
@property (nonatomic, strong) UILabel *faLab;
@property (nonatomic, strong) UILabel *shouTitleLab;
@property (nonatomic, strong) UILabel *shouLab;
@property (nonatomic, strong) UILabel *weightTitleLab;
@property (nonatomic, strong) UILabel *weightLab;
@property (nonatomic, strong) UILabel *tiJiTitleLab;
@property (nonatomic, strong) UILabel *tiJiLab;
@property (nonatomic, strong) UILabel *linkOrderTitleLab;
@property (nonatomic, strong) UILabel *linkOrderLab;
@property (nonatomic, strong) UILabel *yuanShiTitleLab;
@property (nonatomic, strong) UILabel *yuanShiLab;

@property (nonatomic, strong) UILabel *timeTitleLab;
@property (nonatomic, strong) UILabel *beignTimeLab;
@property (nonatomic, strong) UILabel *endTimeLab;
@property (nonatomic, strong) UIView *beginDotView;
@property (nonatomic, strong) UIView *endDotView;
@property (nonatomic, strong) UILabel *timeLine;

@property (nonatomic, strong) UILabel *yaoQiuTitleLab;
@property (nonatomic, strong) UILabel *yaoQiuLab;

@property (nonatomic, strong) UILabel *fuWuTitleLab;
@property (nonatomic, strong) UILabel *fuWuLab;
@property (nonatomic, strong) UILabel *yunShuFangShiTitleLab;
@property (nonatomic, strong) UILabel *yunShuFangShiLab;
@property (nonatomic, strong) UILabel *yunShuShiXiaoTitleLab;
@property (nonatomic, strong) UILabel *yunShuShiXiaoLab;
@property (nonatomic, strong) UILabel *carTitleLab;
@property (nonatomic, strong) UILabel *carLab;
@property (nonatomic, strong) UILabel *jieSuanTitleLab;
@property (nonatomic, strong) UILabel *jieSuanLab;

@property (nonatomic, strong) UILabel *xiaDanTitleLab;
@property (nonatomic, strong) UILabel *xiaDanLab;
@property (nonatomic, strong) UILabel *xiaDanTimeTitleLab;
@property (nonatomic, strong) UILabel *xiaDanTimeLab;
@property (nonatomic, strong) UILabel *baoXianTitleLab;
@property (nonatomic, strong) UILabel *baoXianLab;
@property (nonatomic, strong) UILabel *fileTitleLab;
@property (nonatomic, strong) UILabel *fileLab;
@property (nonatomic, strong) UILabel *remarkTitleLab;
@property (nonatomic, strong) UILabel *remarkLab;

@end

@implementation MyShipmentInfoCell

+ (instancetype)MyShipmentInfoCellWithTableView:(UITableView *)tableView {
    static NSString *cellID = @"MyShipmentInfoCell";
    MyShipmentInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[MyShipmentInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = Color_backgroundColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.bgView = [UIView new];
        self.bgView.backgroundColor = HexColor(0xffffff);
        self.bgView.layer.masksToBounds = YES;
        self.bgView.layer.cornerRadius = 6;
        [self.contentView addSubview:self.bgView];
        
        self.faTitleLab = [UILabel new];
        self.faTitleLab.textColor = HexColor(0x9C9DB3);
        self.faTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.faTitleLab];
        
        self.faLab = [UILabel new];
        self.faLab.textColor = HexColor(0x2B2C44);
        self.faLab.font = [UIFont systemFontOfSize:14];
        self.faLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.faLab];
        
        self.shouTitleLab = [UILabel new];
        self.shouTitleLab.textColor = HexColor(0x9C9DB3);
        self.shouTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.shouTitleLab];
        
        self.shouLab = [UILabel new];
        self.shouLab.textColor = HexColor(0x2B2C44);
        self.shouLab.font = [UIFont systemFontOfSize:14];
        self.shouLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.shouLab];
        
        self.weightTitleLab = [UILabel new];
        self.weightTitleLab.textColor = HexColor(0x9C9DB3);
        self.weightTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.weightTitleLab];
        
        self.weightLab = [UILabel new];
        self.weightLab.textColor = HexColor(0x2B2C44);
        self.weightLab.font = [UIFont systemFontOfSize:14];
        self.weightLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.weightLab];
        
        self.tiJiTitleLab = [UILabel new];
        self.tiJiTitleLab.textColor = HexColor(0x9C9DB3);
        self.tiJiTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.tiJiTitleLab];
        
        self.tiJiLab = [UILabel new];
        self.tiJiLab.textColor = HexColor(0x2B2C44);
        self.tiJiLab.font = [UIFont systemFontOfSize:14];
        self.tiJiLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.tiJiLab];
        
        self.linkOrderTitleLab = [UILabel new];
        self.linkOrderTitleLab.textColor = HexColor(0x9C9DB3);
        self.linkOrderTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.linkOrderTitleLab];
        
        self.linkOrderLab = [UILabel new];
        self.linkOrderLab.textColor = HexColor(0x2B2C44);
        self.linkOrderLab.font = [UIFont systemFontOfSize:14];
        self.linkOrderLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.linkOrderLab];
        
        self.yuanShiTitleLab = [UILabel new];
        self.yuanShiTitleLab.textColor = HexColor(0x9C9DB3);
        self.yuanShiTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.yuanShiTitleLab];
        
        self.yuanShiLab = [UILabel new];
        self.yuanShiLab.textColor = HexColor(0x2B2C44);
        self.yuanShiLab.font = [UIFont systemFontOfSize:14];
        self.yuanShiLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.yuanShiLab];
        
        self.timeTitleLab = [UILabel new];
        self.timeTitleLab.textColor = HexColor(0x9C9DB3);
        self.timeTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.timeTitleLab];
        
        self.beignTimeLab = [UILabel new];
        self.beignTimeLab.textColor = HexColor(0x2B2C44);
        self.beignTimeLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.beignTimeLab];
        
        self.endTimeLab = [UILabel new];
        self.endTimeLab.textColor = HexColor(0x2B2C44);
        self.endTimeLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.endTimeLab];
        
        self.beginDotView = [UIView new];
        self.beginDotView.backgroundColor = HexColor(0x2B2C44);
        [self.bgView addSubview:self.beginDotView];
        
        self.endDotView = [UIView new];
        self.endDotView.backgroundColor = HexColor(0x2B2C44);
        [self.bgView addSubview:self.endDotView];
        
        self.timeLine = [UILabel new];
        self.timeLine.backgroundColor = HexColor(0xBDBED9);
        [self.bgView addSubview:self.timeLine];
        
        self.yaoQiuTitleLab = [UILabel new];
        self.yaoQiuTitleLab.textColor = HexColor(0x9C9DB3);
        self.yaoQiuTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.yaoQiuTitleLab];
        
        self.yaoQiuLab = [UILabel new];
        self.yaoQiuLab.textColor = HexColor(0x2B2C44);
        self.yaoQiuLab.font = [UIFont systemFontOfSize:14];
        self.yaoQiuLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.yaoQiuLab];
        
        self.fuWuTitleLab = [UILabel new];
        self.fuWuTitleLab.textColor = HexColor(0x9C9DB3);
        self.fuWuTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.fuWuTitleLab];
        
        self.fuWuLab = [UILabel new];
        self.fuWuLab.textColor = HexColor(0x2B2C44);
        self.fuWuLab.font = [UIFont systemFontOfSize:14];
        self.fuWuLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.fuWuLab];
        
        self.yunShuFangShiTitleLab = [UILabel new];
        self.yunShuFangShiTitleLab.textColor = HexColor(0x9C9DB3);
        self.yunShuFangShiTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.yunShuFangShiTitleLab];
        
        self.yunShuFangShiLab = [UILabel new];
        self.yunShuFangShiLab.textColor = HexColor(0x2B2C44);
        self.yunShuFangShiLab.font = [UIFont systemFontOfSize:14];
        self.yunShuFangShiLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.yunShuFangShiLab];
        
        self.yunShuShiXiaoTitleLab = [UILabel new];
        self.yunShuShiXiaoTitleLab.textColor = HexColor(0x9C9DB3);
        self.yunShuShiXiaoTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.yunShuShiXiaoTitleLab];
        
        self.yunShuShiXiaoLab = [UILabel new];
        self.yunShuShiXiaoLab.textColor = HexColor(0x2B2C44);
        self.yunShuShiXiaoLab.font = [UIFont systemFontOfSize:14];
        self.yunShuShiXiaoLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.yunShuShiXiaoLab];
        
        self.carTitleLab = [UILabel new];
        self.carTitleLab.textColor = HexColor(0x9C9DB3);
        self.carTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.carTitleLab];
        
        self.carLab = [UILabel new];
        self.carLab.textColor = HexColor(0x2B2C44);
        self.carLab.font = [UIFont systemFontOfSize:14];
        self.carLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.carLab];
        
        self.jieSuanTitleLab = [UILabel new];
        self.jieSuanTitleLab.textColor = HexColor(0x9C9DB3);
        self.jieSuanTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.jieSuanTitleLab];
        
        self.jieSuanLab = [UILabel new];
        self.jieSuanLab.textColor = HexColor(0x2B2C44);
        self.jieSuanLab.font = [UIFont systemFontOfSize:14];
        self.jieSuanLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.jieSuanLab];
        
        self.xiaDanTitleLab = [UILabel new];
        self.xiaDanTitleLab.textColor = HexColor(0x9C9DB3);
        self.xiaDanTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.xiaDanTitleLab];
        
        self.xiaDanLab = [UILabel new];
        self.xiaDanLab.textColor = HexColor(0x2B2C44);
        self.xiaDanLab.font = [UIFont systemFontOfSize:14];
        self.xiaDanLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.xiaDanLab];
        
        self.xiaDanTimeTitleLab = [UILabel new];
        self.xiaDanTimeTitleLab.textColor = HexColor(0x9C9DB3);
        self.xiaDanTimeTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.xiaDanTimeTitleLab];
        
        self.xiaDanTimeLab = [UILabel new];
        self.xiaDanTimeLab.textColor = HexColor(0x2B2C44);
        self.xiaDanTimeLab.font = [UIFont systemFontOfSize:14];
        self.xiaDanTimeLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.xiaDanTimeLab];
        
        self.baoXianTitleLab = [UILabel new];
        self.baoXianTitleLab.textColor = HexColor(0x9C9DB3);
        self.baoXianTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.baoXianTitleLab];
        
        self.baoXianLab = [UILabel new];
        self.baoXianLab.textColor = HexColor(0x2B2C44);
        self.baoXianLab.font = [UIFont systemFontOfSize:14];
        self.baoXianLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.baoXianLab];
        
        self.fileTitleLab = [UILabel new];
        self.fileTitleLab.textColor = HexColor(0x9C9DB3);
        self.fileTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.fileTitleLab];
        
        self.fileLab = [UILabel new];
        self.fileLab.textColor = HexColor(0x2B2C44);
        self.fileLab.font = [UIFont systemFontOfSize:14];
        self.fileLab.textAlignment = NSTextAlignmentRight;
        self.fileLab.numberOfLines = 0;
        [self.bgView addSubview:self.fileLab];
        
        self.remarkTitleLab = [UILabel new];
        self.remarkTitleLab.textColor = HexColor(0x9C9DB3);
        self.remarkTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.remarkTitleLab];
        
        self.remarkLab = [UILabel new];
        self.remarkLab.textColor = HexColor(0x2B2C44);
        self.remarkLab.font = [UIFont systemFontOfSize:14];
        self.remarkLab.textAlignment = NSTextAlignmentRight;
        self.remarkLab.numberOfLines = 0;
        [self.bgView addSubview:self.remarkLab];
    }
    return self;
}

-(void)setModel:(WaybillMainModel *)model {
    _model = model;
    [self configUI];
}

- (void)configUI {
    self.bgView.nim_left = 15;
    self.bgView.nim_top = 10;
    self.bgView.nim_width = ScreenW - 2 * self.bgView.nim_left;
    
    self.faTitleLab.text = @"发货单位：";
    self.faTitleLab.nim_left = 15;
    self.faTitleLab.nim_top = 20;
    [self.faTitleLab sizeToFit];
    
    self.faLab.text = self.model.send_name;
    [self.faLab sizeToFit];
    self.faLab.nim_left = self.bgView.nim_width - 15 - self.faLab.nim_width;
    self.faLab.nim_centerY = self.faTitleLab.nim_centerY;
    
    self.shouTitleLab.text = @"收货单位：";
    self.shouTitleLab.nim_left = 15;
    self.shouTitleLab.nim_top = 10 + self.faTitleLab.nim_bottom;
    [self.shouTitleLab sizeToFit];
    
    self.shouLab.text = self.model.shipper_name;
    [self.shouLab sizeToFit];
    self.shouLab.nim_left = self.bgView.nim_width - 15 - self.shouLab.nim_width;
    self.shouLab.nim_centerY = self.shouTitleLab.nim_centerY;
    
    self.weightTitleLab.text = @"总重量(kg)：";
    self.weightTitleLab.nim_left = 15;
    self.weightTitleLab.nim_top = 10 + self.shouTitleLab.nim_bottom;
    [self.weightTitleLab sizeToFit];
    
    self.weightLab.text = self.model.allWeight;
    [self.weightLab sizeToFit];
    self.weightLab.nim_left = self.bgView.nim_width - 15 - self.weightLab.nim_width;
    self.weightLab.nim_centerY = self.weightTitleLab.nim_centerY;
    
    self.tiJiTitleLab.text = @"总体积(m³)：";
    self.tiJiTitleLab.nim_left = 15;
    self.tiJiTitleLab.nim_top = 10 + self.weightTitleLab.nim_bottom;
    [self.tiJiTitleLab sizeToFit];
    
    self.tiJiLab.text = self.model.allVolume;
    [self.tiJiLab sizeToFit];
    self.tiJiLab.nim_left = self.bgView.nim_width - 15 - self.tiJiLab.nim_width;
    self.tiJiLab.nim_centerY = self.tiJiTitleLab.nim_centerY;
    
    self.linkOrderTitleLab.text = @"关联订单：";
    self.linkOrderTitleLab.nim_left = 15;
    self.linkOrderTitleLab.nim_top = 10 + self.tiJiTitleLab.nim_bottom;
    [self.linkOrderTitleLab sizeToFit];
    
    self.linkOrderLab.text = self.model.aorder;
    [self.linkOrderLab sizeToFit];
    self.linkOrderLab.nim_left = self.bgView.nim_width - 15 - self.linkOrderLab.nim_width;
    self.linkOrderLab.nim_centerY = self.linkOrderTitleLab.nim_centerY;
    
    self.yuanShiTitleLab.text = @"原始单号：";
    self.yuanShiTitleLab.nim_left = 15;
    self.yuanShiTitleLab.nim_top = 10 + self.linkOrderTitleLab.nim_bottom;
    [self.yuanShiTitleLab sizeToFit];
    
    self.yuanShiLab.text = self.model.ynum;
    [self.yuanShiLab sizeToFit];
    self.yuanShiLab.nim_left = self.bgView.nim_width - 15 - self.yuanShiLab.nim_width;
    self.yuanShiLab.nim_centerY = self.yuanShiTitleLab.nim_centerY;
    
    self.timeTitleLab.text = @"提货时间：";
    self.timeTitleLab.nim_left = 15;
    self.timeTitleLab.nim_top = 10 + self.yuanShiTitleLab.nim_bottom;
    [self.timeTitleLab sizeToFit];
    
    self.beignTimeLab.text = self.model.startTime;
    [self.beignTimeLab sizeToFit];
    self.beignTimeLab.nim_left = self.bgView.nim_width - 15 - self.beignTimeLab.nim_width;
    self.beignTimeLab.nim_centerY = self.timeTitleLab.nim_centerY;
    
    self.endTimeLab.text = self.model.endTime;
    [self.endTimeLab sizeToFit];
    self.endTimeLab.nim_left = self.bgView.nim_width - 15 - self.endTimeLab.nim_width;
    self.endTimeLab.nim_top = self.beignTimeLab.nim_bottom + 10;
    
    self.beginDotView.nim_width = 4;
    self.beginDotView.nim_height = 4;
    self.beginDotView.nim_left = (self.beignTimeLab.nim_width > self.endTimeLab.nim_width ? self.beignTimeLab.nim_left : self.endTimeLab.nim_left) - 10 - self.beginDotView.nim_width;
    self.beginDotView.nim_centerY = self.beignTimeLab.nim_centerY;
    
    self.endDotView.nim_width = 4;
    self.endDotView.nim_height = 4;
    self.endDotView.nim_left = self.beginDotView.nim_left;
    self.endDotView.nim_centerY = self.endTimeLab.nim_centerY;
    
    self.timeLine.nim_width = 2;
    self.timeLine.nim_height = self.endDotView.nim_top - self.beginDotView.nim_bottom - 4;
    self.timeLine.nim_centerX = self.beginDotView.nim_centerX;
    self.timeLine.nim_top = self.beginDotView.nim_bottom + 2;
    
    self.yaoQiuTitleLab.text = @"要求到达时间：";
    self.yaoQiuTitleLab.nim_left = 15;
    self.yaoQiuTitleLab.nim_top = 10 + self.endTimeLab.nim_bottom;
    [self.yaoQiuTitleLab sizeToFit];
    
    self.yaoQiuLab.text = self.model.arrivalTime;
    [self.yaoQiuLab sizeToFit];
    self.yaoQiuLab.nim_left = self.bgView.nim_width - 15 - self.yaoQiuLab.nim_width;
    self.yaoQiuLab.nim_centerY = self.yaoQiuTitleLab.nim_centerY;
    
    self.fuWuTitleLab.nim_left = self.yaoQiuTitleLab.nim_left;
    self.fuWuTitleLab.nim_top = self.yaoQiuTitleLab.nim_bottom + 10;
    self.fuWuTitleLab.text = @"服务方式：";
    [self.fuWuTitleLab sizeToFit];
    
    self.fuWuLab.nim_left = self.fuWuTitleLab.nim_right;
    self.fuWuLab.text = self.model.delivery;
    [self.fuWuLab sizeToFit];
    self.fuWuLab.nim_centerY = self.fuWuTitleLab.nim_centerY;
    self.fuWuLab.nim_width = self.bgView.nim_width - 15 - self.fuWuLab.nim_left;
    
    self.yunShuFangShiTitleLab.nim_left = self.yaoQiuTitleLab.nim_left;
    self.yunShuFangShiTitleLab.nim_top = self.fuWuTitleLab.nim_bottom + 10;
    self.yunShuFangShiTitleLab.text = @"运输方式：";
    [self.yunShuFangShiTitleLab sizeToFit];
    
    self.yunShuFangShiLab.nim_left = self.yunShuFangShiTitleLab.nim_right;
    self.yunShuFangShiLab.text = self.model.transport;
    [self.yunShuFangShiLab sizeToFit];
    self.yunShuFangShiLab.nim_centerY = self.yunShuFangShiTitleLab.nim_centerY;
    self.yunShuFangShiLab.nim_width = self.bgView.nim_width - 15 - self.yunShuFangShiLab.nim_left;
    
    self.yunShuShiXiaoTitleLab.nim_left = self.yaoQiuTitleLab.nim_left;
    self.yunShuShiXiaoTitleLab.nim_top = self.yunShuFangShiTitleLab.nim_bottom + 10;
    self.yunShuShiXiaoTitleLab.text = @"运输时效：";
    [self.yunShuShiXiaoTitleLab sizeToFit];
    
    self.yunShuShiXiaoLab.nim_left = self.yunShuShiXiaoTitleLab.nim_right;
    self.yunShuShiXiaoLab.text = self.model.tsTime;
    [self.yunShuShiXiaoLab sizeToFit];
    self.yunShuShiXiaoLab.nim_centerY = self.yunShuShiXiaoTitleLab.nim_centerY;
    self.yunShuShiXiaoLab.nim_width = self.bgView.nim_width - 15 - self.yunShuShiXiaoLab.nim_left;
    
    self.carTitleLab.nim_left = self.yaoQiuTitleLab.nim_left;
    self.carTitleLab.nim_top = self.yunShuShiXiaoTitleLab.nim_bottom + 10;
    self.carTitleLab.text = @"车辆要求：";
    [self.carTitleLab sizeToFit];
    
    self.carLab.nim_left = self.fuWuTitleLab.nim_right;
    self.carLab.text = [NSString stringWithFormat:@"%@,%@",self.model.carLength,self.model.needCar];
    [self.carLab sizeToFit];
    self.carLab.nim_centerY = self.carTitleLab.nim_centerY;
    self.carLab.nim_width = self.bgView.nim_width - 15 - self.carLab.nim_left;
    
    self.jieSuanTitleLab.nim_left = self.timeTitleLab.nim_left;
    self.jieSuanTitleLab.nim_top = self.carTitleLab.nim_bottom + 10;
    self.jieSuanTitleLab.text = @"结算方式：";
    [self.jieSuanTitleLab sizeToFit];
    
    self.jieSuanLab.nim_left = self.jieSuanTitleLab.nim_right;
    self.jieSuanLab.text = self.model.settleSty;
    [self.jieSuanLab sizeToFit];
    self.jieSuanLab.nim_centerY = self.jieSuanTitleLab.nim_centerY;
    self.jieSuanLab.nim_width = self.bgView.nim_width - 15 - self.jieSuanLab.nim_left;
    
    self.xiaDanTitleLab.nim_left = self.timeTitleLab.nim_left;
    self.xiaDanTitleLab.nim_top = self.jieSuanTitleLab.nim_bottom + 10;
    self.xiaDanTitleLab.text = @"下单方式：";
    [self.xiaDanTitleLab sizeToFit];
    
    self.xiaDanLab.nim_left = self.xiaDanTitleLab.nim_right;
    self.xiaDanLab.text = self.model.pOrder;
    [self.xiaDanLab sizeToFit];
    self.xiaDanLab.nim_centerY = self.xiaDanTitleLab.nim_centerY;
    self.xiaDanLab.nim_width = self.bgView.nim_width - 15 - self.xiaDanLab.nim_left;
    
    self.xiaDanTimeTitleLab.nim_left = self.timeTitleLab.nim_left;
    self.xiaDanTimeTitleLab.nim_top = self.xiaDanTitleLab.nim_bottom + 10;
    self.xiaDanTimeTitleLab.text = @"下单时间：";
    [self.xiaDanTimeTitleLab sizeToFit];
    
    self.xiaDanTimeLab.nim_left = self.xiaDanTimeTitleLab.nim_right;
    self.xiaDanTimeLab.text = self.model.orderTime;
    [self.xiaDanTimeLab sizeToFit];
    self.xiaDanTimeLab.nim_centerY = self.xiaDanTimeTitleLab.nim_centerY;
    self.xiaDanTimeLab.nim_width = self.bgView.nim_width - 15 - self.xiaDanTimeLab.nim_left;
    
    self.baoXianTitleLab.nim_left = self.timeTitleLab.nim_left;
    self.baoXianTitleLab.nim_top = self.xiaDanTimeTitleLab.nim_bottom + 10;
    self.baoXianTitleLab.text = @"保险声明价值(元)：";
    [self.baoXianTitleLab sizeToFit];
    
    self.baoXianLab.nim_left = self.fuWuTitleLab.nim_right;
    self.baoXianLab.text = self.model.price;
    [self.baoXianLab sizeToFit];
    self.baoXianLab.nim_centerY = self.baoXianTitleLab.nim_centerY;
    self.baoXianLab.nim_width = self.bgView.nim_width - 15 - self.baoXianLab.nim_left;
    
    self.fileTitleLab.nim_left = self.timeTitleLab.nim_left;
    self.fileTitleLab.nim_top = self.baoXianTitleLab.nim_bottom + 10;
    self.fileTitleLab.text = @"随附文件：";
    [self.fileTitleLab sizeToFit];
    
    self.fileLab.nim_left = self.fileTitleLab.nim_right + 10;
    self.fileLab.nim_top = self.fileTitleLab.nim_top;
    self.fileLab.nim_width = self.bgView.nim_width - 15 - self.fileLab.nim_left;
    self.fileLab.text = self.model.fileInfo;
    [self.fileLab sizeToFit];
    self.fileLab.nim_width = self.bgView.nim_width - 15 - self.fileLab.nim_left;
    
    self.remarkTitleLab.nim_left = self.timeTitleLab.nim_left;
    self.remarkTitleLab.nim_top = (self.model.fileInfo.length ? self.fileLab.nim_bottom : self.fileTitleLab.nim_bottom) + 10;
    self.remarkTitleLab.text = @"备注：";
    [self.remarkTitleLab sizeToFit];
    
    self.remarkLab.nim_left = self.remarkTitleLab.nim_right + 10;
    self.remarkLab.nim_top = self.remarkTitleLab.nim_top;
    self.remarkLab.nim_width = self.bgView.nim_width - 15 - self.remarkLab.nim_left;
    self.remarkLab.text = self.model.remarks;
    [self.remarkLab sizeToFit];
    self.remarkLab.nim_width = self.bgView.nim_width - 15 - self.remarkLab.nim_left;
    
    self.bgView.nim_height = (self.model.remarks.length ? self.remarkLab.nim_bottom : self.remarkTitleLab.nim_bottom) + 20;
    
    self.height = self.bgView.nim_bottom;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
